/************************************************************************/
/* @file            gxMath.h                                            */
/* @brief           Base math def                                       */
/* @version         2013.11.17 johnxguo created                         */
/************************************************************************/

#ifndef __GX_MATH_H_INCLUDED__
#define __GX_MATH_H_INCLUDED__

#include "gxPlatform.h"
#include "gxType.h"
#include <math.h>
#include <float.h>
#include <stdlib.h>
#include <limits.h>

#ifndef _GX_WINDOWS_
#define sqrtf(X) (gx::f32)sqrt((gx::f64)(X))
#define sinf(X) (gx::f32)sin((gx::f64)(X))
#define cosf(X) (gx::f32)cos((gx::f64)(X))
#define asinf(X) (gx::f32)asin((gx::f64)(X))
#define acosf(X) (gx::f32)acos((gx::f64)(X))
#define atan2f(X,Y) (gx::f32)atan2((gx::f64)(X),(gx::f64)(Y))
#define ceilf(X) (gx::f32)ceil((gx::f64)(X))
#define floorf(X) (gx::f32)floor((gx::f64)(X))
#define powf(X,Y) (gx::f32)pow((gx::f64)(X),(gx::f64)(Y))
#define fmodf(X,Y) (gx::f32)fmod((gx::f64)(X),(gx::f64)(Y))
#define fabsf(X) (gx::f32)fabs((gx::f64)(X))
#define logf(X) (gx::f32)log((gx::f64)(X))
#endif

#endif